<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
      <input type="text" v-model.lazy="msg">
      {{ msg }}
      <hr>
      <input type="text" v-model.number="num">
      {{ num }}
      <hr>
      <input type="text" v-model.trim="inputTxt">
      {{ inputTxt }}
      <button @click="fn">增加</button>
  </div>
  <script src="./vue.js"></script>
  <script>
    const vm = new Vue({
      el: '#app',
      data: {
        msg: '你好vue',
        num:'',
        inputTxt:''
      },
      methods: {
        fn(){
          if(this.inputTxt === '') {
            return;
          }
          alert(1)
        }
      }
    })
  
  </script>
</body>
</html>